package com.lagou.guavacache.enums;

import lombok.Getter;

@Getter
public enum CompanyTypeEnum {
    TYPE_1("不需要融资", 1),
    TYPE_2("A轮", 2),
    TYPE_3("B轮", 3),
    TYPE_4("C轮", 4),
    TYPE_5("D轮", 5),
    TYPE_6("E轮", 6),
    TYPE_7("F轮", 7),
    TYPE_8("上市公司", 8);

    private String name;
    private int code;

    CompanyTypeEnum(String name, int code) {
        this.name = name;
        this.code = code;
    }

    public static String getNameByCode(int code) {
        for (CompanyTypeEnum item : CompanyTypeEnum.values()) {
            if (item.getCode() == code) {
                return item.getName();
            }
        }
        return null;
    }
}
